package dhome.tasks;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.PersistJobDataAfterExecution;

@DisallowConcurrentExecution
@PersistJobDataAfterExecution
public abstract class QuartzJob implements Job {	
	
	public abstract String get_schedule();

	public abstract void go(JobDataMap map);
	
	public String getName(){
		return this.getClass().getName();
	}
	public String getGroup() {
		return "default";
	}
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		JobDetail job = context.getJobDetail();
		go(job.getJobDataMap());
	}
	
}
